from os.path import dirname, join
from PyQt5.QtCore import QUrl
from PyQt5.QtMultimedia import QMediaPlayer, QMediaContent
from PyQt5.QtWidgets import QApplication

app = QApplication([])
media_player = QMediaPlayer()
file_path = join(dirname(__file__), "res", "test.mp3")
url = QUrl.fromLocalFile(file_path)
media_player.setMedia(QMediaContent(url))
media_player.play()
app.exec_()